package com.pojo.req;

import com.utility.gruops.InsertGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;

/**
 * <p>
 * 消息发送任务
 * </p>
 *
 * @author admin
 * @since 2022-12-05
 */
@Data
public class MessageTaskReq{

    private static final long serialVersionUID = 1L;

    private Long id;

    /**
     * 应用code
     */
    @NotBlank(message = "应用code不能为空",groups = {InsertGroup.class})
    @Length(min = 1,max = 128,message = "应用code只允许长度1 ~ 128位长度",groups = {InsertGroup.class})
    private String applicationCode;

    /**
     * 发送方式：0：立即发送  1：定时发送
     */
    @NotBlank(message = "发送方式不能为空",groups = {InsertGroup.class})
    @Range(min = 0,max = 1,message = "发送方式只允许0 ~ 1的类型",groups = {InsertGroup.class})
    private String messageMode;

    /**
     * 消息类型：0：站内信消息  1：邮件消息  2：短信消息
     */
    @NotBlank(message = "消息类型不能为空",groups = {InsertGroup.class})
    @Range(min = 0,max = 2,message = "消息类型只允许0 ~ 2的类型",groups = {InsertGroup.class})
    private String messageType;

    /**
     * 发送时间
     */
    private LocalDateTime startDate;

    /**
     * 结束时间
     */
    private LocalDateTime endDate;

    /**
     * 消息接收人
     */
    @NotBlank(message = "消息接收人不能为空",groups = {InsertGroup.class})
    @Length(min = 1,max = 20,message = "接收人id只允许20位字符",groups = {InsertGroup.class})
    private Long userId;

    /**
     * 消息内容
     */
    @NotBlank(message = "消息内容不能为空",groups = {InsertGroup.class})
    @Length(min = 1,max = 522,message = "消息内容只允许1 ~ 522位字符",groups = {InsertGroup.class})
    private String body;

    /**
     * 消息标题
     */
    @NotBlank(message = "消息标题不能为空",groups = {InsertGroup.class})
    @Length(min = 1,max = 128,message = "消息标题只允许1 ~ 128位字符",groups = {InsertGroup.class})
    private String title;


}
